/*
Copyright (c) [2019年5月1日] [吴超]
[MBT_Studio] is licensed under Mulan PSL v2.
You can use this software according to the terms and conditions of the Mulan PSL v2.
You may obtain a copy of Mulan PSL v2 at:
		 http://license.coscl.org.cn/MulanPSL2
THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
See the Mulan PSL v2 for more details.
*/
#pragma once


#include <线性代数/几何计算.h>


typedef struct S_坐标二叉树节点 {
	S_坐标二叉树节点* m_L节点;
	S_坐标二叉树节点* m_R节点;
	void* p_data;
}S_坐标二叉树节点;

typedef struct {
	uint32 m_倍数;

	S_坐标二叉树节点* m_Root;

}S_坐标二叉树;

#define 容器_声明二叉树创建(type_name)	\
	typedef struct S_##二叉树节点 {		\
		S_##二叉树节点* m_L节点;		\
		S_##二叉树节点* m_R节点;		\
		void* p_data;					\
	}S_##二叉树节点;					\





typedef struct {
	uint32 m_倍数;

	S_坐标二叉树节点* m_Root;

}S_坐标层级树;





typedef struct {
	uint16* m_倍数;
	suvec2	m_Dim;
	float32	m_Size;
}S_坐标索引层;

typedef struct {
	S_坐标索引层*	m_倍数;
	uint8			m_层数量;
}S_坐标索引层组;



S_坐标二叉树* f_create坐标二叉树(uint32 倍数);

void f_add坐标节点(const vec2& coord);

void f_get坐标节点(const vec2& coord);

void f_move节点(const vec2& coord);

void f_del坐标节点(const vec2& coord);




S_坐标索引层组* f_create坐标索引层(float32 总大小, uint16 最大维度, uint8 层数);

void f_map_get坐标索引(S_坐标索引层组* layer, vec2 size, vec2 coord);
void f_map_move坐标索引元素(S_坐标索引层组* layer, vec2 size, vec2 new_coord);


//容器_声明二叉树创建(mbt)



